var  clickState = true;
$(function(){
	$("#save-button").click(function(){
		var shipCompany = $("input[name='shipCompany']").val();
		var shipNo = $("input[name='shipNo']").val();
		var shipDate = $("#shipDate").val();
		if(shipCompany.length == 0){
			layer.msg("请输入物流公司");
			return false;
		}
		if(shipNo.length == 0){
			layer.msg("请输入物流单号");
			return false;
		}
		if(shipDate.length == 0){
			layer.msg("请选择发货日期");
			return false;
		}
		var refundId=init.refundId;
		var express ={
			"refundId":refundId,
			"shipCompany":shipCompany,
			"shipNo":shipNo,
			"shipDate":shipDate
		}
		if(clickState){
			clickState = false;
			$.ajax({
				url:basePath+"/refund/saveExpress.shtml",
				data:express,
				type:"post",
				dataType:"JSON",
				success:ajaxSuccessCloseFun
			});
		}
	});
	$("#close-button").click(function(){
		parent.closeLayer(0);
	});
	
});
